cmake_minimum_required(VERSION 3.17)
project(test)

set(CMAKE_CXX_STANDARD 11)

# ------------------------------------------------------------------
# gtest
# ------------------------------------------------------------------
include_directories("/usr/local/include")
link_directories("/usr/local/lib/")


# ------------------------------------------------------------------
# source files
# ------------------------------------------------------------------
include_directories(src/samples1)
AUX_SOURCE_DIRECTORY(src/samples1 samples1_code)

include_directories(src/samples2)
AUX_SOURCE_DIRECTORY(src/samples2 samples2_code)

include_directories(src/samples3)
AUX_SOURCE_DIRECTORY(src/samples3 samples3_code)

include_directories(src/samples4)
AUX_SOURCE_DIRECTORY(src/samples4 samples4_code)

include_directories(src/samples5)
AUX_SOURCE_DIRECTORY(src/samples5 samples5_code)

include_directories(src/samples678)
AUX_SOURCE_DIRECTORY(src/samples678 samples6_code)

include_directories(src/samples9)
AUX_SOURCE_DIRECTORY(src/samples9 samples9_code)

include_directories(src/samples10)
AUX_SOURCE_DIRECTORY(src/samples10 samples10_code)

include_directories(src/moke)
AUX_SOURCE_DIRECTORY(src/moke moke_code)

add_executable(test main.cpp
        ${samples1_code}
        ${samples2_code}
        ${samples3_code}
        ${samples4_code}
        ${samples5_code}
        ${samples6_code}
        )
target_link_libraries(test pthread gtest)

# 事件案例， 可以定制化输出，但是必须包含 main
add_executable(test_cb ${samples9_code})
target_link_libraries(test_cb pthread gtest)

# 内存泄露检测
add_executable(test_malloc ${samples10_code})
target_link_libraries(test_malloc pthread gtest)

# 内存泄露检测
add_executable(test_moke ${moke_code})
target_link_libraries(test_moke pthread gtest gmoke)
